using System;
using System.Collections;
using System.Xml;
using InfoJetSoft.Service.Entity;
using InfoJetSoft.Service.Util;

//CID 0237 //2009.03.02 //Begin
namespace InfoJetSoft.Service.Util
{
	/// <summary>
	/// Summary description for MergeMatchNode.
	/// </summary>
	class MergeMatch
	{
		public XmlNode itemNode = null;
		public XmlNode matchNode = null;
		public string matchValue = null;

		public static ArrayList collectMergeMatchList( ImportAction importAction, ArrayList nodeList, NamespaceResolver nsResolver )
		{
			ArrayList mergeMatchList = new ArrayList();
			foreach( XmlNode node in nodeList )
			{
				MergeMatch mergeMatch = new MergeMatch();
				mergeMatch.itemNode = node;
				mergeMatch.matchNode = DOMUtil.selectANode( node, importAction.insert.match, nsResolver );
				if( mergeMatch.matchNode != null )
				{
					mergeMatch.matchValue = DOMUtil.getNodeValue( mergeMatch.matchNode );
				}
				mergeMatchList.Add( mergeMatch );
			}
			return mergeMatchList;
		}
	}
}
//CID 0237 //2009.03.02 //End